package GUI;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;
public class usernameFrame extends JFrame implements ActionListener{
	public JFrame frame;
	private JButton jButton1;
    private JLabel jLabel1;
    private JPanel jPanel1;
    private JTextField jTextField1;
    
    public usernameFrame() {
    	frame = new JFrame();
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	frame.setTitle("Enter a Username");
    	frame.setSize(300,150);
    	frame.setLocationRelativeTo(null);
    	
    	jPanel1 = new JPanel(new BorderLayout());
    	
    	JPanel jPanel2 = new JPanel();
    	jLabel1 = new JLabel("Please enter a username:");
    	jPanel2.add(jLabel1);
    	jPanel1.add(jPanel2, BorderLayout.NORTH);
    	
    	JPanel jPanel3 = new JPanel();
    	jTextField1 = new JTextField();
    	jTextField1.setPreferredSize(new Dimension(100, 20));
    	jPanel3.add(jTextField1);
    	jPanel1.add(jPanel3, BorderLayout.CENTER);
    	
    	JPanel jPanel4 = new JPanel();
    	jButton1 = new JButton("Submit");
    	jButton1.addActionListener(this);
    	jPanel4.add(jButton1);
    	jPanel1.add(jPanel4, BorderLayout.SOUTH);
    	
    	frame.add(jPanel1);
    	frame.setVisible(true);
    }

	@Override
	public void actionPerformed(ActionEvent arg0) {
		new mainFrame().setVisible(true);
		frame.setVisible(false);
		
	}
}
